package bank.command;

import framework.account.IAccount;
import framework.command.ICommand;
import framework.command.IFunctor;

import java.util.List;

public class AddInterestCommand implements ICommand {
    private List<IAccount> accounts;

    public AddInterestCommand(List<IAccount> accounts) {
        this.accounts = accounts;
    }

    public void execute() {
        throw new UnsupportedOperationException();
    }

    @Override
    public void execute(IFunctor functor) {
        for (IAccount acc : accounts) {
            functor.process(acc);
        }
    }
}
